<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>@yield('title', '商务管理中心')</title>
    <meta name="keywords" content="@yield('keywords', setting('keywords'))">
    <meta name="description" content="@yield('description', setting('description'))">
    <meta name="csrf-token" content="{{csrf_token()}}">
    <link href="{{asset('images/common/favicon.png')}}" rel="icon">
    <link href="{{asset('css/user.css')}}" rel="stylesheet" type="text/css">
    <script src="{{asset('js/base.js?'.time())}}" type="text/javascript"></script>
    <script src="{{asset('DatePicker/WdatePicker.js')}}"></script>
</head>
<body>
<div class="blank"></div>

<div class="area">
    <div class="mainframe" style="margin: 0;">
        <div class="main-content">
            <ul class="breadcrumb" style="position: relative;">
                <li class="breadcrumb-item active">商务管理中心</li>
                <li style="position: absolute; right: 10px;"><a href="{{url('employee/logout')}}">退出登录</a></li>
            </ul>
            <div class="search-container">
                <form method="get" id="searchForm">
                    <div class="row">
                        <div class="cell">
                            <label>日期:</label>
                            <div class="field">
                                <div class="con"><input title="" type="text" class="form-control w100" name="time_begin" onclick="WdatePicker()" value="{{$time_begin}}"></div>
                                <div class="con">-</div>
                                <div class="con"><input title="" type="text" class="form-control w100" name="time_end" onclick="WdatePicker()" value="{{$time_end}}"></div>
                            </div>
                        </div>
                        <div class="cell">
                            <div class="field">
                                <button type="button" class="btn btn-primary" id="search">搜索</button>
                                <button type="button" class="btn btn-default" id="export">导出</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>

            <div class="content-div">
                <table cellpadding="0" cellspacing="0" width="100%" border="0" class="listtable">
                    <thead>
                    <tr>
                        <th width="60">头像</th>
                        <th>用户名</th>
                        <th width="160">个人业绩</th>
                        <th width="160">个人佣金</th>
                        <th width="160">节点业绩</th>
                        <th width="160">节点佣金</th>
                        <th width="100">日期</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($items as $item)
                        <tr>
                            <td>
                                <div class="pic">
                                    <a href="{{url('employee/relations?upuid='.$user['uid'])}}"><img src="{{avatar($user['uid'])}}"></a>
                                </div>
                            </td>
                            <td><h3 class="title"><a href="{{url('employee/relations?upuid='.$user['uid'])}}">{{$user['username']}}</a></h3></td>
                            <td>{{$item['achievement']}}</td>
                            <td>{{$item['commission']}}</td>
                            <td>{{$item['node_achievement']}}</td>
                            <td>{{$item['node_commission']}}</td>
                            <td>{{@date('Y-m-d', $item['created_at'])}}</td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
            <div class="pagination-container">{!! $pagination !!}</div>
        </div>
    </div>
</div>
@include('common.footer')
<script type="text/javascript">
    $("#search").on('click', function () {
        $("#searchForm").attr('action', '{{url('employee')}}')
            .attr('target', '_self').submit();
    });
    $("#export").on('click', function () {
        $("#searchForm").attr('action', '{{url('employee/exportme')}}')
            .attr('target', '_self').submit();
    });
</script>
</body>
</html>
